package com.example.springboot.controller;

import com.example.springboot.common.Result;
import com.example.springboot.entity.jobs;
import com.example.springboot.entity.user;
import com.example.springboot.service.JobsCreateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin(origins = "http://localhost:7070")
@RestController
@RequestMapping("/JobsCreateController")
public class JobsCreateController {


    @Autowired
    private JobsCreateService jobsCreateService;

    @GetMapping("/AllJobsById")
    public Result AllJobsById(@RequestParam int company_id){
        List<jobs> list = jobsCreateService.AllJobsById(company_id);
        return Result.success(list);
    }

    @PostMapping("/addJobs")
    public Result addJobs(@RequestBody jobs jobs) {
        System.out.println(jobs);
        jobsCreateService.addJobs(jobs);
        return Result.success("添加成功");
    }

}
